package com.gt.xmall.service;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;


import com.gt.xmall.service.BaseService;

import com.gt.xmall.model.GtdCriteria;
import com.gt.xmall.repository.GtdCriteriaDao;



@Component
@Transactional(readOnly = true)
public class GtdCriteriaService extends BaseService{
	@Autowired
	private GtdCriteriaDao gtdCriteriaDao;
	
	public List<GtdCriteria> getGtdCriterias(){
		return (List<GtdCriteria>)gtdCriteriaDao.findAll();
	}
	
	public GtdCriteria getGtdCriteria(Long id){
		return gtdCriteriaDao.findOne(id);
	}
	@Transactional(readOnly = false)
	public GtdCriteria saveGtdCriteria(GtdCriteria gtdCriteria){
		return gtdCriteriaDao.save(gtdCriteria);
	}
	
	@Transactional(readOnly = false)
	public void deleteGtdCriteria(Long id){
		 gtdCriteriaDao.delete(id);
	}
	
}